<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>

<style type="text/css">
    * { margin: 0px; padding: 0px; }

    #blank { width: 1024px; height: 50px; }

    #main{
        width: 500px;
        margin: 0 auto;
    }

    .yelloGreen{
        border: 1px solid #000;
        width: 80px;
        background-color: greenyellow;
    }

    .classImportance {
        color: darkorchid;
    }
</style>
<script type="text/javascript">
    window.onload = function myLoadTwo() {
        window.document.getElementById("buttonBack").onclick = function back() {
            window.location.href = "/examStudent/grid.do";
        }
    }

</script>
<div id="blank">
</div>
<div id="main">
    <form id="formAdd" action="/examStudent/input.do" method="post">
        <table width="500" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>姓名</td>
                <td><input type="text" name="name" value=""></td>
                <td class="classImportance">必填项</td>
            </tr>
            <tr>
                <td>学号</td>
                <td><input type="text" name="code" value=""></td>
                <td class="classImportance">必填项</td>
            </tr>
            <tr>
                <td>性别</td>
                <td>
                    <select id="sex" name="sex">
                        <option value="1">男</option>
                        <option value="0">女</option>
                    </select>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>出生日期</td>
                <td><input type="text" name="bornDate" value=""></td>
                <td class="classImportance">必填项</td>
            </tr>
            <tr>
                <td>所在班级</td>
                <td>
                    <select id="examClassName" name="examClassName">
                        <c:forEach var="examClasses" items="${examClasses}" varStatus="status">
                            <option value="${examClasses.id}">${examClasses.name}</option>
                        </c:forEach>
                    </select>
                </td>
                <td class="classImportance">必填项</td>
            </tr>
            <tr>
                <td>选择课程</td>
                <td>
                    <c:forEach var="examCourses" items="${examCourses}" varStatus="status">
                        <label><input type="checkbox" name="courseName" value="${examCourses.id}">${examCourses.name}
                        </label><br>
                    </c:forEach>
                </td>
                <td class="classImportance">必填项</td>
            </tr>
            <tr style="height: 60px">
                <td></td>
                <td>
                    <input type="submit" class="yelloGreen" name="submit" value="确定">
                    <input type="reset" class="yelloGreen" name="reset" value="取消">
                </td>
                <td>
                    <input type="button" class="yelloGreen" id="buttonBack" name="buttonBack" value="返回" />
                </td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">
    var result = ${requestScope.result};
    if (result == -1) {
        alert("该课程人数超过10人了！")
    }
</script>